﻿using System;
using System.Collections.Generic;
using XmlServer.ServiceContracts;

namespace XmlServer.ServiceImplementation
{
    /// <summary>
    /// The response from a IOperator
    /// </summary>
    public class Response : IResponse
    {

        public Response()
        {
            // capture the start tick time with the response is created
            this.StartProcessing = System.Environment.TickCount;
        }


        /// <summary>
        /// True/False indicating if the respose was successfully processed
        /// </summary>
        public bool Success { get; set; }

        /// <summary>
        /// The tick mark when processing started
        /// </summary>
        public int StartProcessing { get; set; }

        /// <summary>
        /// The tick mark when processing finished
        /// </summary>
        public int StopProcessing { get; set; }

        /// <summary>
        /// The total processing time in the Operator
        /// </summary>
        public int TotalProcessingTime { get; set; }

        /// <summary>
        /// The collection of facts that are responding to the request
        /// </summary>
        public List<IFact> Facts { get; set; }

        /// <summary>
        /// The original request to the operator
        /// </summary>
        public IRequest Request { get; set; }

    }
}
